﻿@model CMSApplication.Areas.Administration.Models.CustomerTypeModel 
@{
    ViewBag.Title = "CS Loai khach hang";
    AjaxOptions ajaxOpts = new AjaxOptions
    {
        HttpMethod = "post",
        OnComplete = "CompleteAjaxRequest"
    };
}
<script>
    function CompleteAjaxRequest(obj) {
        var returnObj = eval('(' + obj.responseText + ')');
        if (returnObj.Status == "success") {
            if (returnObj.Message != null) {
                $.pnotify({
                    title: 'Success',
                    text: returnObj.Message,
                    type: 'info',
                    opacity: .8
                });
            }
            else if (returnObj.RedirectUrl != null) {
                window.location.href = returnObj.RedirectUrl;
            }
        } else {
            $.pnotify({
                title: 'Error',
                text: returnObj.Message,
                type: 'error',
                opacity: .8
            });
        }
        return false;
    };
</script>
<div class="row-fluid">
    <div class="span12">
        <div class="head">
            <div class="isw-documents"></div>
            <h1>Chỉnh sửa loại khách hàng: Mã = @Model.Id</h1>
            <div class="clear"></div>
        </div>
        <div class="block-fluid">
            @using (Html.BeginForm("AddOrUpdate", "CustomerType", FormMethod.Post, new { enctype = "multipart/form-data", @id="validation" }))
            {
                <div class="warning-area"></div>
                @Html.HiddenFor(model => model.Id)
                @Html.HiddenFor(model => model.Order)
                <div class="row-form">
                    <div class="span2">Tên</div>
                    <div class="span10">@Html.TextBoxFor(x => x.Name, new { @class = "validate[required]" })</div>
                    <div class="clear"></div>
                </div>
                <div class="row-form">
                    <div class="span2">Mô tả</div>
                    <div class="span10">@Html.TextAreaFor(x => x.Desc, new { @cols = "5", @rows = "5", @style = "height:50px;" })</div>
                    <div class="clear"></div>
                </div>
                <div class="row-form">
                    <div class="span2"></div>
                    <div class="span10">
                        <input type="submit" class="btn btn-info btnSubmit" value="Lưu lại" /></div>
                        <div class="clear"></div>
                </div>
            }
        </div>
    </div>
</div>
